package com.wwwc.index.web.servlet;

import java.io.*;
import java.awt.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.ServletRequestWrapper;
import java.net.*;

import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;

import com.wwwc.util.web.*;
import com.wwwc.index.web.ejb.database.*;

public class UserBean {
    private EJBDatabaseQuery ejbdb;
    private String query = null;

    public StringBuffer getAddAndSearchBar(String call_path, String mid, boolean admin) {
	StringBuffer sbf = new StringBuffer();

	sbf.append("\n<TABLE cellSpacing='2' cellPadding=0 border=0>");
	sbf.append("\n<TR>");
	sbf.append(MyHtml.makeLinkCell("Add", call_path+"?mid="+mid+"&aid=2"));

	sbf.append("\n<TD align=center bgcolor='#AABBCC' style='border:1 solid #808080' width="+(10+50*6+10)+">");
	sbf.append("\n<Form name='searchForm' method=post action='"+call_path+"?mid="+mid+"&aid=0-1'>");
	sbf.append("\n<input type=text name=sq value='' size=50 maxLength=50 style='font-size:6pt'>");
	sbf.append("\n</TD>");

	sbf.append(MyHtml.makeLinkCell("Search","javaScript:document.searchForm.submit();"));
	sbf.append("\n</FORM>");

	if(admin) {
	    sbf.append(MyHtml.makeLinkCell("Edit", call_path+"?mid="+mid+"&aid=9-1"));
	}
	sbf.append("\n</TR>");
	sbf.append("\n</TABLE>");
	return sbf;
    }

    public StringBuffer getUserSubdirInfo (String sub_dir, String user_name) {
	StringBuffer sbf = new StringBuffer();
	sbf.append("\n<TABLE cellSpacing='0' cellPadding='2' border='0' ");
	sbf.append(" width='100%' style='border-bottom:1px solid; font-size: 8pt'>");
	sbf.append("\n<TR>");
	sbf.append("\n<TD align='center' style='color:#6600CC' bgcolor='#669999'>");
	sbf.append("<B>"+user_name.toUpperCase()+"'s/"+sub_dir+"</B></TD>");
	sbf.append("\n<TD align='center' style='color:#6600CC' bgcolor='#999966'>");
	sbf.append("Manager:&nbsp;["+user_name+"]</TD>");
	sbf.append("\n<TD align='center' style='color:#6600CC' bgcolor='#669999'>");
	sbf.append("\n</TR>");
	sbf.append("\n</TABLE>");
	return sbf;
    }
 }






